    //
//  RS5ViewController.m
//  SmartRoadShow
//
//  Created by simon on 10-9-17.
//  Copyright 2010 simonwang142232@gmail.com. All rights reserved.
//

#import "RS5ViewController.h"

static int kNumberOfImages = 22;

@implementation RS5ViewController



- (void)viewDidLoad {
    [super viewDidLoad];
	self.view.backgroundColor = [UIColor blackColor];
	
	myCoverFlow = [[AFOpenFlowView alloc] initWithFrame:CGRectMake(0, 0, 320, 345)];
	myCoverFlow.rs5vc = self;
	
	[myCoverFlow setDataSource:self];
	[myCoverFlow setViewDelegate:self];
	
	myCoverFlow.numberOfImages = kNumberOfImages;
	
	for (int i = 0; i < kNumberOfImages; i++) {
		UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%d.jpg",i+1]];
		[myCoverFlow setImage:image forIndex:i];
	}
	[self.view addSubview:myCoverFlow];
	
}

#pragma mark -
#pragma mark Open Cover Flow Delegate & DataSource
- (void)openFlowView:(AFOpenFlowView *)openFlowView requestImageForIndex:(int)index{
}

- (void)openFlowView:(AFOpenFlowView *)openFlowView selectionDidChange:(int)index{
	currentImageIndex = index;
}

- (UIImage *)defaultImage{
	return nil;
}


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Overriden to allow any orientation.
    return YES;
}


- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}


- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
	myCoverFlow = nil;
}


- (void)dealloc {
    [super dealloc];
	[myCoverFlow release];
}


@end
